﻿using SDi.Login.Model;
using System.Web;

namespace SDi.Login
{
    public class SDiGlobal : HttpApplication
    {
        public static string USER_SESSION = "$User";

        public static User AuthenticatedUser
        {
            get {
                if (HttpContext.Current.ApplicationInstance.Session[USER_SESSION] as User != null)
                {
                    return HttpContext.Current.ApplicationInstance.Session[USER_SESSION] as User;
                }
                else
                {
                    return null;
                }
            }
            set { HttpContext.Current.ApplicationInstance.Session[USER_SESSION] = value; }
        }

        public static void RedirectToHomePage()
        {

        }

        public static void RedirectToHomePage(string message)
        {

        }
        
    }
}
